#! /bin/bash

# (c) Thomas Lange, 2001-2013, lange@debian.org

error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code

ifclass XORG && {
    fcopy -M /etc/X11/xorg.conf
}

if ifclass UBUNTU; then
     groups="adm cdrom sudo dip plugdev lpadmin sambashare"
     $ROOTCMD addgroup --system lpadmin || true
     $ROOTCMD addgroup --system sambashare || true
fi

# add a demo user account
if ! $ROOTCMD getent passwd demo ; then
    $ROOTCMD adduser --disabled-login --gecos "fai demo user" demo
    $ROOTCMD usermod -p "$ROOTPW" demo
    for g in $groups; do
	$ROOTCMD adduser demo $g
    done
fi
